fix placement of placeholder text in QLineEdits with action icons
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 28 Nov 2021 14:12:50 +0000 (14:12 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 28 Nov 2021 14:12:50 +0000 (14:12 +0000)
commita2c81232dbf0d00ff272bb70f1d8ee8514970833
tree5df5351ad49fae71a3317db746f9b1a307df6f37
parent0678245340c18ed976c39451a0407bfd8dd904f6
fix placement of placeholder text in QLineEdits with action icons

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0e6b31019f01c72e
Last-Update: 2021-08-10

After dc794f7622bc00f7ca50fab65d6965695d6d2972, side widgets only got
space if they were not fading out, but the logic was not correctly
accounting for side widgets that never fade, such as buttons added via
QLineEdit::addAction.

Fix this to give visible widgets space, unless they are fading out. That
was the intent of the original change. Rename the variable to make its
purpose clearer, and reset it at the end of the fade-out animation.

Add a much-needed test that relies on private APIs to verify that the
effective margins are calculated correctly.

Gbp-Pq: Name fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.diff
src/widgets/widgets/qlineedit_p.cpp
src/widgets/widgets/qlineedit_p.h
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp